import { ref } from "vue";
import { defineStore } from "pinia";
export const useCurrentUserStore = defineStore(
  "currentUser",
  () => {
    const currentUser = ref<any>({});
    function setCurrentUser(newUser: Object) {
      currentUser.value = newUser;
    }
    return {
      currentUser,
      setCurrentUser,
    };
  },
  {
    // 默认持久化在 cookie 中
    persist: true,
  }
);
